Try to delete any existing W32 status icons when DPI changes
authorРуслан Ижбулатов <lrn1986@gmail.com>
Mon, 18 Jul 2016 10:32:04 +0000 (10:32 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Mon, 18 Jul 2016 10:32:04 +0000 (10:32 +0000)
Fixes some or all of the issues reported in
https://github.com/hexchat/hexchat/issues/1423

gtk/deprecated/gtkstatusicon.c

index a29c1b7ede356e11ce853a4e4397610dc22cd5da..7df11cdec1693624e9ef65f087194fb659454e04 100644 (file)
@@ -728,6 +728,12 @@ wndproc (HWND   hwnd,
          GtkStatusIcon *status_icon = GTK_STATUS_ICON (rover->data);
          GtkStatusIconPrivate *priv = status_icon->priv;
 
+         /* taskbar_created_msg is also fired when DPI changes. Try to delete existing icons if possible. */
+         if (!Shell_NotifyIconW (NIM_DELETE, &priv->nid))
+         {
+               g_warning (G_STRLOC ": Shell_NotifyIcon(NIM_DELETE) on existing icon failed");
+         }
+
          priv->nid.hWnd = hwnd;
          priv->nid.uID = status_icon_id++;
          priv->nid.uCallbackMessage = WM_GTK_TRAY_NOTIFICATION;